#!/bin/bash
# This script shows the total space wasted by duplicate files
# as reported by findup (pipe findup to this).

bytes=`cut -f1                            | # grab x * y
       sed -e 's/* \([0-9]*\)/* \1 - \1/' | # x * y --> x * y - y
       bc                                 | # calulate each of above
       (tr '\n' '+'; echo 0)              | # add all of above
       bc`                                  # final answer

echo "Total wasted space: ${bytes:-0} bytes"
